package lib.validation;

import java.util.ArrayList;
import java.util.List;

public class ValidationHandler 
{
	private List<Message> messages = new ArrayList<Message>();
	public ValidationHandler(List<Message> messages)
	{
		this.messages = messages;
	}
	public ValidationHandler() {

	}
	public List<Message> getMessages()
	{
		return messages;
	}
	public void addMessage(Message m)
	{
		messages.add(m);
	}
	public boolean isValid()
	{
		for (int i = 0; i < messages.size(); i++) 
		{
			if (!messages.get(i).isValid())
				return false;
		}
		return true;
	}
}
